package com.cnbm.wcsbasic.dispatch.constant;

/**
 * @Author: 蔡翔
 * @Date: 2019/11/3 11:30
 * @Version 1.0
 */
public class QGSConstant {
    public static final Object LOCK = new Object();

    public static final Long deadLineTime = 300000L;

    //wms 需提供 post 接口
    //public static final String wmsUrl = "http://localhost:8089/wms-qy/work/wcs2wms/taskcallback";
    public static final String wmsUrl = "http://192.168.1.76:48081/admin-api/asrs/external-interface/stacker";

    public static final String ddjCallbackUrl = "http://172.22.22.190:48081/admin-api/asrs/external-interface/callBack/rgvCallBack";
    public static final String lineInCallbackUrl = "http://172.22.22.190:48081/admin-api/asrs/external-interface/callBack/lineInCallBack";
    public static final String lineOutCallbackUrl = "http://172.22.22.190:48081/admin-api/asrs/external-interface/callBack/lineOutCallBack";

    public static final String agvPortCallbackUrl = "http://172.22.22.190:48081/admin-api/asrs/external-interface/callBack/packCallBack";


    public static final String DDJ1Name = "DDJ1";
    public static final String DDJ2Name = "DDJ2";
    public static final String DDJ3Name = "DDJ3";
    public static final String DDJ4Name = "DDJ4";


    public static String parseLineAlarmCode(Integer errCode){
        if(errCode == null){
            return "采集异常";
        }
        switch(errCode)
        {
            case 1 :
                return "运行";
            case 2 :
                return "完成";
            case 30 :
                return "手动";
            case 31 :
                return "急停";
            case 33 :
                return "超时";
            case 35 :
                return "托盘位置错误";
            case 36 :
                return "电机过热";
            case 37 :
                return "变频故障";
            case 38 :
                return "电辊筒故障";
            case 39 :
                return "货物阻塞";
            case 41 :
                return "二号急停";
            case 42 :
                return "二号线体急停";
            case 43 :
                return "二号超时";
            case 45 :
                return "二号尺寸故障";
            case 46 :
                return "二号电机故障";
            case 47 :
                return "二号变频故障";
            case 48 :
                return "二号原点极限";
            case 49 :
                return "二号到位极限";
            case 51 :
                return "超宽宽";
            case 52 :
                return "超宽中";
            case 53 :
                return "超宽窄";
            case 54 :
                return "超高高";
            case 55 :
                return "超高中";
            case 56 :
                return "超高矮";
            case 57 :
                return "前坍塌";
            case 58 :
                return "后坍塌";
            case 59 :
                return "尺寸过长";
            case 60 :
                return "尺寸过短";
            case 61 :
                return "条码错误";
            case 62 :
                return "扫码失败";
            case 63 :
                return "超重报警";
            case 0 :
                return "空闲";
            default :
                return errCode.toString();
        }
    }

    public static String parseAlarmCode(Integer errCode){
        if(errCode == null){
            return "采集异常";
        }
        switch(errCode)
        {
            case 30 :
                return "手动";
            case 31 :
                return "急停";
            case 32 :
                return "行走变频器故障";
            case 33 :
                return "升降变频器故障";
            case 34 :
                return "近叉变频器故障";
            case 35 :
                return "取货后近叉无货";
            case 36 :
                return "放货时近叉货架有货";
            case 37 :
                return "放货后近叉有货";
            case 38 :
                return "取货时近叉有货";
            case 39 :
                return "放货时近叉无货";
            case 40 :
                return "取货地址错误";
            case 41 :
                return "放货地址错误";
            case 42 :
                return "高货低送报警";
            case 43 :
                return "货物超高";
            case 44 :
                return "货物超宽";
            case 45 :
                return "货物坍塌";
            case 46 :
                return "货叉不居中";

            case 47 :
                return "近叉左中位信号异常";
            case 48 :
                return "近叉右中位信号异常";

            case 49 :
                return "近叉左到位信号异常";
            case 50 :
                return "近叉右到位信号异常";
            case 51 :
                return "货叉运行超时";
            case 52 :
                return "提升取上升超时";
            case 53 :
                return "提升放下降超时";
            case 54 :
                return "超载故障";
            case 55 :
                return "松绳故障";
            case 56 :
                return "上限位";
            case 57 :
                return "下限位";
            case 58 :
                return "前限位";
            case 59 :
                return "后限位";
            case 60 :
                return "目标地址未设置";
            case 61 :
                return "横轴软限位";
            case 62 :
                return "纵轴软限位";
            case 63 :
                return "横停过界";
            case 64 :
                return "纵停过界";
            case 65 :
                return "升降失速";
            case 66 :
                return "行走失速";
            case 67 :
                return "升降时码值未变";
            case 68 :
                return "行走时码值未变";
            case 69 :
                return "升降目标超限";
            case 70 :
                return "行走目标超限";

            case 71 :
                return "升降速度异常";
            case 72 :
                return "行走速度异常";
            case 73 :
                return "升降未在正常范围值内";
            case 74 :
                return "行走未在正常范围值内";


            case 75 :
                return "光通讯断";
            case 76 :
                return "取货时站台未就绪";
            case 77 :
                return "放货时站台未就绪";
            case 78 :
                return "制动电阻过热";

            case 79 :
                return "应急";
            case 80 :
                return "行走方向错误";
            case 81 :
                return "升降方向错误";
            case 82 :
                return "上位任务号为零";
            case 83 :
                return "上位条码值为零";
            case 84 :
                return "上位货物尺寸为零";
            case 91 :
                return "深浅叉码值同时变化";
            case 92 :
                return "失速夹钳开关报警";

            case 93 :
                return "浅叉回路异常";
            case 94 :
                return "深叉回路异常";

            case 95 :
                return "叉取深货位时浅货位有货";
            case 96 :
                return "叉放远货位时浅深货位有货";
            case 97 :
                return "取货时货叉电流过大";
            case 98 :
                return "心跳异常";
            case 99 :
                return "安全门打开";
            case 100 :
                return "PLC机架网络故障";
            case 101 :
                return "前避障急停";
            case 102 :
                return "后避障急停";
            case 103 :
                return "前避障报警";
            case 104 :
                return "后避障报警";
            case 105 :
                return "前避障警告";
            case 106 :
                return "后避障警告";

            case 0 :
                return "正常无报警";

            default :
                return errCode.toString();
        }
    }
}

